import request from '@/utils/request'

/**
 * 文章列表
 * @param {Object} params 
 */
export function queryArticlePage(params) {
  return request({
    url: '/system/article/list',
    method: 'get',
    params: params
  })
}


/**
 * 文章导出
 * @param {String} id 
 */
export function articleExport(data) {
  return request({
    url: '/system/article/export',
    method: 'post',
    data: data
  })
}


/**
 * 文章详情
 * @param {String} id 
 */
export function queryArticleDetail(id) {
  return request({
    url: '/system/article/'+id,
    method: 'get'
  })
}

/**
 * 新增文章
 * @param {Object} data 
 */
export function addArticle(data) {
  return request({
    url: '/system/article',
    method: 'post',
    data: data
  })
}


/**
 * 编辑文章
 * @param {Object} data 
 */
export function editArticle(data) {
  return request({
    url: '/system/article',
    method: 'put',
    data: data
  })
}


/**
 * 删除文章
 * @param {String} ids 
 */
export function deleteArticle(ids) {
  return request({
    url: '/system/article/'+ids,
    method: 'delete',
    data: data
  })
}


/**
 * 批量文章审核
 * @param {String} ids 
 */
export function articleVerify(ids) {
    return request({
      url: '/system/article/verify/'+ids,
      method: 'put',
    })
  }

/**
 * 批量撤销文章
 * @param {String} ids 
 */
export function undoArticle(ids) {
  return request({
    url: '/system/article/undo/'+ids,
    method: 'put',
  })
}